package com.usefullc.common.enums;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 风控条件结果处理方式
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum RiskCheckConditionResType {

    RANDOM_CODE(0, "随机数验证"),
    SMS(1, "短信"),
    FINGERPRINT(2, "指纹"),
    FACE(3, "人脸"),
    REJECT(4, "拒绝服务"),

    ;
    private int code;
    private String value;

    RiskCheckConditionResType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static RiskCheckConditionResType getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (RiskCheckConditionResType s : RiskCheckConditionResType.values()) {
            if (s.getCode() == code) {
                return s;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
